package org.pzy.java.base;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author pzy
 */
public class Array2ListDemo {
    public static void main(String[] args) {
        Integer[] arr = new Integer[]{1, 2, 3, 4, 5};
        List<Integer> asList = Arrays.asList(arr);
//        asList.add(1, 2); //UnsupportedOperationException
        List<Integer> list = new ArrayList<>(asList);
        list.add(1, 2);
        System.out.println(list);
    }
}
